var app = getApp();

Page({
    data: {},
    onLoad: function(o) {
        console.log(o);
        if (null == o.scene) if (0 < (n = o.arr).indexOf("%")) {
            console.log("包含");
            var e = n.split("%"), t = e[0], i = e[1].slice(2);
            console.log(e), console.log(t), console.log(i);
        } else t = n.split(",")[0], i = n.split(",")[1]; else {
            var n;
            t = (n = o.arr).split(",")[0], i = n.split(",")[1];
        }
        console.log("票券id " + t), console.log("活动发布人id " + i);
        var s = this;
        app.getUserInfo(function(o) {
            s.setData({
                user_id: o.id,
                ticket_id: t
            }), app.util.request({
                url: "entry/wxapp/AddVerification",
                cachetime: "0",
                data: {
                    user_id: user_id,
                    hx_id: user_id
                },
                success: function(o) {
                    console.log(o);
                }
            });
        });
    },
    add_market: function(o) {
        var e = this.data.user_id, t = this.data.ticket_id;
        console.log(t), console.log(e), app.util.request({
            url: "entry/wxapp/IsHx",
            cachetime: "0",
            data: {
                ticket_id: t,
                user_id: e
            },
            success: function(o) {
                console.log(o), 1 == o.data ? wx.showToast({
                    title: "核销成功"
                }) : wx.showToast({
                    title: "核销失败"
                }), setTimeout(function() {
                    wx.redirectTo({
                        url: "../index/index"
                    });
                }, 1500);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});